/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetoesa;

import java.util.ArrayList;

/**
 *
 * @author Heitor
 */
public class CadastroSecretario {
    
    ArrayList<Secretario> secretario = new ArrayList<Secretario>();
    
    
      public void addSecretario(Secretario sec){
        this.secretario.add(sec);
    }
    
    
    public void removeSecretario(String nome){
        for (int j = 0; j < this.secretario.size(); j++) {
            if (nome.equals(secretario.get(j).getNome())) {
                secretario.remove(j);
            }
         }
    }
    
   public Secretario buscarSecretario(String nome){
      
       for (int i=0;i<secretario.size();i++) {
      if(secretario.get(i).getNome().equals(nome)){
           return secretario.get(i);
      } 
    }return null;
  }
    
    
    
    
}
